package com.crud.project.service;

import com.crud.project.dao.IRoleDao;
import com.crud.project.po.Permission;
import com.crud.project.po.Role;
import com.crud.project.po.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class RoleService {
    @Resource
    private IRoleDao iRoleDao;
    public List<Role> findAll() {
        List<Role>roleList=iRoleDao.findAll();
        return roleList;
    }
    public void insertRole(Role role){
        iRoleDao.insertRole(role);
    }

   public Role findRoleById(Long id){
       Role role=iRoleDao.findRoleById(id);
        return role;
   }
   public void updateRole(Role role){
        iRoleDao.updateRole(role);
   }

    public void deleteRole(Long id) {
        iRoleDao.deleteById(id);
    }

    public List<String> findPermissionId(Long id){
        return iRoleDao.findPermissionId(id);

    }

}
